package com.note.simpleshop.module.coupon.dao;

import com.note.simpleshop.entity.TbCoupon;
import com.note.simpleshop.entity.TbGivedCoupon;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface GivedCouponRepository extends JpaRepository<TbGivedCoupon, String> {
    Long countByUserIdAndCouponId(String userId,String couponId);

    /***
     * 获取用户优惠券信息
     * @param userId
     * @param couponIds
     * @return
     */
    List<TbGivedCoupon> findByUserIdAndCouponIdIn(String userId,List<String> couponIds);
}
